/*捕获规则配置*/
import request from '@/utils/request';

// 查询原始包捕获规则数据
export function getOriginalDataFilter(query: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/originalDataFilter',
		method: 'post',
		data: query,
	});
}

// 根据ID查询原始包捕获规则数据
export function getById(id: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/originalDataFilter/' + id,
		method: 'get',
	});
}

// 清理数据
export function clearData(type: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/metadata/probe/capture/config/clearData/' + type,
		method: 'delete',
	});
}

// 查询业务服务资源列表
export function getBusinessResourceList(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/resource',
		method: 'post',
		data: data,
	});
}

// 新增原始包捕获规则
export function addOriginalData(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/originalDataFilter/save',
		method: 'post',
		data: data,
	});
}

// 修改原始包捕获规则
export function save(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/originalDataFilter',
		method: 'put',
		data: data,
	});
}

// 发送规则
export function sendFilterRule(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/metadata/probe/capture/config/sendFilterRule',
		method: 'post',
		data: data,
	});
}

// 停用启用后,同步状态均改为 同步中
export function updateStatus(data: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/metadata/probe/capture/config/updateStatus',
		method: 'post',
		data: data,
	});
}

// 批量删除
export function deleteOriginalDataFilterByIds(ids: any): ApiPromise<ApiResponse> {
	return request({
		url: '/management/originalDataFilter/delete/' + ids,
		method: 'delete',
	});
}
